package sevensoft.行为型模式.观察者模式;

import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.TimeUnit;

public class Demo {
    public static void main(String[] args) throws ExecutionException, InterruptedException {
        //创建发布者
        SubSubject subSubject = new SubSubject();

        //创建观察者
        subSubject.attach(new User("111"));
        subSubject.attach(new User("222"));

        //接收消息
        subSubject.notify("新消息");
    }


}
